#ifndef FRACTURE_BODY_H
#define FRACTURE_BODY_H

//#include "PhysicsBody.h"
#include "Vec3.h"
#include <LinearMath\btAlignedObjectArray.h>
#include <LinearMath\btVector3.h>
#include <LinearMath\btQuaternion.h>
#include <vector>
#include <set>


class Fragment;
//class btRigidBody;

class FractureBody 
{
public:

	virtual void Update() = 0;
	virtual void Shatter() {};
	void GetVerticesInsidePlanes(const btAlignedObjectArray<btVector3>& planes, btAlignedObjectArray<btVector3>& verticesOut, std::set<int>& planeIndicesOut);
	void voronoiBBShatter(const btAlignedObjectArray<btVector3>& points, const btVector3& bbmin, const btVector3& bbmax, const btQuaternion& bbq, const btVector3& bbt, btScalar matDensity, const btVector3& linVel);
	void voronoiConvexHullShatter(const btAlignedObjectArray<btVector3>& points, const btAlignedObjectArray<btVector3>& verts, const btQuaternion& bbq, const btVector3& bbt, btScalar matDensity, const btVector3& linVel);

	//void RemoveRigidBody();
protected:
	double m_soundSpeedInMedium;

	std::vector<Fragment*> m_fragments;
};

#endif